const Koa = require('koa')
const jwt = require('koa-jwt');  
const app = new Koa()
const useRouters = require('./router/index.js')
const cors = require('@koa/cors');
const { bodyParser } = require("@koa/bodyparser");


// 解决跨域
app.use(cors());

// 解析post请求的参数
app.use(bodyParser())



// 提供前端可以访问的接口
useRouters(app)

app.listen(3000, () => {
  console.log('server is running at port 3000')
})